package com.fzu.ess.ess.entity;

import com.fzu.ess.common.entity.BaseEntity;
import com.fzu.ess.sys.entity.User;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by ercha on 2015/10/24.
 */
@Entity
@Data
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="ess_profile")
public class Profile extends BaseEntity {
    public Profile(){ super(); }

    public Profile(String id){
        super();
        this.id = id;
    }

    @Column(name="avatar")
    private String avatar;          //用户头像 url

    /**
     * 处理状态
     * 0：女
     * 1：男
     */
    @Column(name="sex")
    private Integer sex;            //性别

    @JoinColumn(name="tel")
    private String tel;             //联系电话

    @Column(name="address")
    private String address;         //联系地址

    @ManyToOne
    @JoinColumn(name="user_id")
    private User user;              //所属用户

    @Column(name="update_date")
    private Date updateDate;       //最后更新的时间
}
